package com.omkarpatil.learningjpa2.mapping.manytoone.bidi;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity(name = "MtoBidiEmployee")
@Table(name = "mto_bidi_employee")
public class Employee implements Serializable {
	
	private int id;
	private String name;
	private Project project;
	
	public Employee() {}
	
	public Employee(String name) {
		super();
		this.name = name;
	}
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	private void setId(int id) {
		this.id = id;
	}

	@Column(nullable = false, length = 30)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne
	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}
}